package com.pw.study.streamx;

import com.streamxhub.streamx.flink.core.StreamEnvConfig;
import com.streamxhub.streamx.flink.core.java.source.KafkaSource;
import com.streamxhub.streamx.flink.core.scala.StreamingContext;


/**
 * @Author: linux_future
 * @since: 2022/3/30
 **/
public class StreamXKafkaSource {
    public static void main(String[] args) {
        // 配置
        StreamEnvConfig javaConfig = new StreamEnvConfig(args, null);
        System.out.println(javaConfig.toString());
        // 创建StreamingContext对象, 是一个核心类
        StreamingContext ctx = new StreamingContext(javaConfig);
        new KafkaSource<String>(ctx).topic("s1")
                .getDataStream()
                .map(x->x.value()).print("one:");
        ctx.start();
    }

}
